CC=g++
CFLAGS=-Wall -std=c++11 -pthread -g

all : client.o server.o common_functions.o
	@echo Compilation complète
	$(CC) $(CFLAGS) client.o common_functions.o sock.cc sockdist.cc -o client
	$(CC) $(CFLAGS) server.o common_functions.o sock.cc sockdist.cc -o server
	@echo "Compilation réussie."

clean :
	@echo Suppression .o
	rm -vf $(wildcard *.o)
clean_pg :
	@echo Suppression executables
	rm -rf server
	rm -rf client
clean_all :
	@echo Nettoyage complet
	rm -rf server
	rm -rf client
	rm -vf $(wildcard *.o)

client.o : client.cc
	$(CC) $(CFLAGS) -c client.cc sock.cc sockdist.cc

server.o : server.cc
	$(CC) $(CFLAGS) -c server.cc sock.cc sockdist.cc
common_functions.o : common_functions.cc
	$(CC) $(CFLAGS) -c common_functions.cc
